package com.itheima.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface CountMapper {
    @Select("select gender , count(*) from emp e group by e.gender")
    List<Map> genderCount();


    @Select("select p.product_name,sum(num) from sales_items s left join product p on s.product_id=p.id group by p.product_name order by sum(num)")
    List<Map> salesCount();


    @Select("select level,count(*) from supermarket.vip group by level")
    List<Map> vipCount();
}
